import request from "@/utils/request";

/**
 * 获取应急救援计划列表
 * @param {*} query
 * @returns
 */
export function getRescueList(query) {
    return request({
        url: "/hd/savePlan/list",
        method: "get",
        params: query,
    });
}

/**
 * 创建救援计划
 * @param {*} data
 * @returns
 */
export function savePlan(data) {
    return request({
        url: "/hd/savePlan",
        method: "post",
        data: data,
    });
}

/**
 * 修改救援计划
 * @param {*} data
 * @returns
 */
export function updatePlan(data) {
    return request({
        url: "/hd/savePlan",
        method: "put",
        data: data,
    });
}

/**
 * 救援计划总指挥设置
 * @param {*} data
 * @returns
 */
export function planLeaderSet(data) {
    return request({
        url: "/hd/savePlan",
        method: "put",
        data: data,
    });
}

/**
 * 添加救援事件信息
 * @param {*} data
 * @returns
 */
export function savePlanEvent(data) {
    return request({
        url: "/hd/saveInfo",
        method: "post",
        data: data,
    });
}

/**
 * 修改救援事件信息
 * @param {*} data
 * @returns
 */
export function updatePlanEvent(data) {
    return request({
        url: "/hd/saveInfo",
        method: "put",
        data: data,
    });
}

/**
 * 获取救援事件详情
 * @param {*} query
 * @returns
 */
export function getPlanEventInfo(id) {
    return request({
        url: "/hd/saveInfo/" + id,
        method: "get",
    });
}

/**
 * 获取救援计划详情
 * @param {*} id
 * @returns
 */
export function getPlanInfo(id) {
    return request({
        url: "/hd/savePlan/" + id,
        method: "get",
    });
}

/**
 * 设置预案和响应级别
 * @param {*} data
 * @returns
 * @deprecated 没有使用场景，所以废除了
 */
export function choosePlanAndLevel(data) {
    return request({
        url: "/hd/savePlan/choosePlanAndLevel",
        method: "post",
        data: data,
    });
}

/**
 * 开启救援计划处置
 * @param {*} data
 * @returns
 */
export function startPlan(id) {
    return request({
        url: "/hd/savePlan/openPlan/" + id,
        method: "put",
    });
}
